﻿//自动义双击方法
function CustomDbClick() {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    var vid = record.getData("HodometerId");
    var teacher = record.getData("UName");
    if (vid != "") {
        window.parent.$("#tabs").tabs('close', '查看总结共享信息');
        var pagetitle = "查看总结共享信息";
        parent.addTabs(pagetitle, '../Crm/Hodometer/InCalendarSum.aspx?r=' + Math.random() + '&TNAME=' + teacher + '&view=check&entity=' + const_EditEntity + '&HDID=' + vid + '&title=' + encodeURI(pagetitle));
        parent.NeedRefreshPage = this;
    }
}
var fnSubStr = function (elCell, oRecord, oColumn, sData) {
    sData = sData.replace("@@@@", "");
    if (sData.length > 25) {
        elCell.innerHTML = sData.substring(0, 25) + "..." + "<a href='javascript:CustomDbClick()'>详细</a>";
    }
    else {
        elCell.innerHTML = sData;
    }
};
//我要评论
var fnAddGains = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    document.getElementById("EditUIWindow").src = "../Crm/Hodometer/AddComment.aspx?r=" + Math.random() + "&type=0&entity=CrmInnerComment&id=" + record.getData(const_entityID);
    //SetMinDWH(YAHOO.example.container.dialog1);
    document.getElementById("yui-gen7-button").style.display = "none";
    YAHOO.example.container.dialog1.show();
}
//查看评论
var fnResult = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    document.getElementById("EditUIWindow").src = "../Crm/Hodometer/CommentList.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID);
    //SetMinDWH(YAHOO.example.container.dialog1);
    document.getElementById("yui-gen7-button").style.display = "none";
    YAHOO.example.container.dialog1.show();
}
